package cn.example.common.protocol.structs;

import lombok.Data;
import java.util.Map;
import cn.hutool.core.map.MapUtil;
import org.artifact.core.lang.DTO;
@Data
/**
 * 邮件
 */
public class MailDTO implements DTO{
	/** 唯一标示 */
	private long id;
	/** 标题 */
	private java.lang.String title;
	/** 内容 */
	private java.lang.String content;
	/** 附件 */
	private java.util.Map<java.lang.Integer, java.lang.Integer> items = new java.util.HashMap<>();
	/** 状态 */
	private int status;
	/** 创建时间(秒) */
	private long createTime;

	public Map<Object, Object> toMap(Map<Object, Object> map){
		map.put(3355,this.id);
		map.put(110371416,this.title);
		map.put(951530617,this.content);
		map.put(100526016,this.items);
		map.put(-892481550,this.status);
		map.put(1369213417,this.createTime);
	    return map;
	}

	public MailDTO forMap(Map<Object, Object> map){
        this.id = MapUtil.getLong(map ,3355);
        this.title = MapUtil.getStr(map ,110371416);
        this.content = MapUtil.getStr(map ,951530617);
        this.items = MapUtil.get(map ,100526016,java.util.Map.class);
        this.status = MapUtil.getInt(map ,-892481550);
        this.createTime = MapUtil.getLong(map ,1369213417);
        return this;
    }
}